package com.sls.core.util;
/**
 * 
 * @description 手拉手游戏接口数据校验
 * @author Wangxuegang
 * @date  2013-1-29
 */
public class SlsDataCheck {
	
	/**
	 * 校验绑定IP是否合法
	 * @param userIP
	 *              接口访问时获取的下游用户IP
	 * @param bindIPList
	 *               用户绑定的IP列表
	 * @return
	 */
	public static boolean checkBindIP(String userIP,String bindIPList){
		boolean flag = false;
		if (bindIPList != null && !("".equals(bindIPList))) {
			String[] bindIPListArr = bindIPList.split(";");
			for (int i = 0; i < bindIPListArr.length; i++) {
				String bindIP = bindIPListArr[i];
				if (userIP.equals(bindIP)) {
					flag = true;
					break;
				}
			}
		}
		
		return flag;
	}
}
